<!DOCTYPE html>
<title>Test video controls visibility when mouse is not over controls.</title>
<script src="../resources/testharness.js"></script>
<script src="../resources/testharnessreport.js"></script>
<script src="media-controls.js"></script>
<video controls loop></video>
<script>
async_test(function(t) {
    var video = document.querySelector("video");

    video.oncanplaythrough = t.step_func(function() {
        assert_true(video.paused);

        // Click the play button.
        var coords = elementCoordinates(enabledPlayButton(video));
        eventSender.mouseMoveTo(coords[0], coords[1]);
        eventSender.mouseDown();
        eventSender.mouseUp();
        assert_false(video.paused);

        runAfterHideMediaControlsTimerFired(t.step_func_done(function() {
            var controls = mediaControlsButton(video, "panel");
            assert_true(controls.classList.contains("transparent"));
        }), video);

        // Move the mouse to the upper-left corner of the video.
        eventSender.mouseMoveTo(video.offsetLeft + 4, video.offsetTop + 4);
    });

    video.src = "content/test.ogv";
});
</script>
